import request from '@/router/axios';



export const getList = (current, size,params) => {
  return request({
    url: '/api/hg-logistics/inventory/loc/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const add = (row) => {
  console.log(row);
  return request({
    url: '/api/hg-logistics/inventory/loc/submit',
    method: 'post',
    data: row
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/hg-logistics/inventory/loc/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const getAreaTree = () => {
  return request({
    url: '/api/hg-logistics/inventory/area/items',
    method: 'get',
  })
}

export const getAreaInfo = (id) => {
  return request({
    url: '/api/hg-logistics/inventory/area/info',
    method: 'get',
    params:{
      id,
    }
  })
}

export const getMaterial = (materialName)=>{
  return request({
    url: '/api/hg-public/material/info/list',
    method: 'get',
    params:{
      "materialName":materialName
    }
  })
}

export const getMaterialList = (current,size,data) => {
  return request({
    url: '/api/hg-public/material/info/page',
    method: 'get',
    params: {
      ...data,
      current,
      size,
    }
  })
}


export const getMaterialLists = (params) => {
  return request({
    url: '/api/hg-public/material/info/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getChildList = (current, size, locName) => {
  return request({
    url: '/api/hg-logistics/inventory/manage/list',
    method: 'get',
    params: {
      locName,
      current,
      size,
    }
  })
}
